package cn.qn.properties;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;
import org.springframework.validation.annotation.Validated;

import javax.validation.constraints.NotNull;

/**
 * @Auther: Bryant
 * @Date: 2018/5/10
 * @Description: 阿里云短信发送密钥对
 */
@Component
@ConfigurationProperties(prefix = "aliyun.sms")
@PropertySource("classpath:commons.properties")
@Validated
@Data
public class AliyunSmsProperties {

    /**
     * 短信发送Key
     */
    @NotNull
    private String accessKeyId;

    /**
     * 短信发送密钥
     */
    @NotNull
    private String accessKeySecret;

    /**
     * 短信签名
     */
    @NotNull
    private String signName;

    /**
     * 超时时间
     */
    @NotNull
    private String defaultConnectTimeout;

    /**
     * 超时时间
     */
    @NotNull
    private String defaultReadTimeout;

    /**
     * 尝试次数
     */
    private Integer tryTimes;
}
